{extend name='admin@public/content'}
{block name='style'}
<style>
    img:hover{
        background-color: grey;
    }
</style>
{/block}
{block name='content'}
<div class="alert alert-danger" role="alert">
    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <strong>图片请上传png格式的透明图</strong>
</div>
<form onsubmit="return false;" action="" data-auto="true" method="post" class='form-horizontal layui-form' style='padding-top:20px'>
    <div class="row">
    {foreach $db as $k=>$v}
    <div class="col-sm-2">
        <div class="panel panel-default">
            <div class="panel-body">
                <div>
                <img data-tips-image style="height:auto;max-width:50%;" src="{$v.content.thumb ?: '__STATIC__/theme/img/image.png'}"/>
                <input type="hidden" name="{$v.id}[thumb]" onchange="$(this).prev('img').attr('src', this.value)" value="{$v.content.thumb ?: ''}" class="layui-input">
                <a class="btn btn-link" data-file="one" data-uptype="" data-width="" data-height="" data-type="png,jpg,jpeg" data-field="{$v.id}[thumb]">上传图片</a>
                </div>
                <div>
                <img data-tips-image style="height:auto;max-width:50%" src="{$v.content.thumb2 ?: '__STATIC__/theme/img/image.png'}"/>
                <input type="hidden" name="{$v.id}[thumb2]" onchange="$(this).prev('img').attr('src', this.value)" value="{$v.content.thumb2 ?: ''}" class="layui-input">
                <a class="btn btn-link" data-file="one" data-uptype="" data-width="" data-height="" data-type="png,jpg,jpeg" data-field="{$v.id}[thumb2]">上传图片</a>
                </div>

                标题：<input type="text" name="{$v.id}[title]" value="{$v.content.title}" class="layui-input">
                内容：<input type="text" name="{$v.id}[content]" value="{$v.content.content}" class="layui-input">
            </div>
        </div>
    </div>

    {/foreach}
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-8">
        <div class="layui-form-item text-left">
            <button class="layui-btn" type="submit">保存</button>
        </div>
    </div>
</form>

{/block}
{block name="script"}
<script>

</script>
{/block}